<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<?php
$this->addCssFile('/project/apps/ecga/styles/style.css');
$this->addCssFile('/project/apps/ecga/styles/form.css');

$this->addScriptFile('/statics/js/mootools/core.js');
$this->addScriptFile('/statics/js/mootools/more.js');
?>
<body>
    <?php $this->import('tips'); ?>

    <div class="action-header">
        <h3><?php  $this->put('管理员分组添加');?></h3>
        <p class="action-desc"><?php $this->put('您可以在这里添加管理员分组的信息，或者点击这里返回'); ?><?php $this->txtLink('管理员分组列表', './mastergroup.php?a=show'); ?>。</p>
    </div>


    <form id="theForm" action="./mastergroup.php?a=doAdd" method="post" enctype="multipart/form-data">
        <div class="box">
            <div class="head">
                <p><?php $this->put('基本信息'); ?></p>
            </div>
            <div class="body">
                <dl class="formrow">
                    <dt>
                        <?php $this->put('管理员分组名称:');?>
                    </dt>
                    <dd>
                        <input type="hidden" name="formHash" value="<?php $this->put($formHash);?>" />
                        <input type="text"  name="groupName"  value="<?php $this->put($data->groupName);?>" class="text required msgPos:'groupNameAdvice'" />
                        <div id="groupNameAdvice" class="hint"></div>
                        <div class="field-hints">管理员分组名称系统唯一，不能重复。</div>
                    </dd>
                </dl>

                <dl class="formrow">
                    <dt>
                        <?php $this->put('可操作权限:');?>
                    </dt>
                    <dd>
                        <select name="allowControls[]" multiple size="10" class="auth-selectbox required valide-one-selected msgPos:'allowControlsAdvice'">
                            <option value="">请选择</option>
                            <?php foreach ($authOptions as $controlTitle => $controls):?>
                            <optgroup label="<?php $this->put($controlTitle);?>">
                                <?php $this->htmlOptions($controls)?>
                            </optgroup>
                            <?php endforeach;?>
                        </select>
                        <div class="hint" id="allowControlsAdvice"></div>
                    </dd>
                </dl>
                
                <dl class="formrow">
                    <dt>
                        <?php $this->put('可查看项目:'); ?>
                    </dt>
                    <dd>
                        <select name="allowProjects[]" multiple size="5" class="auth-selectbox required valide-one-selected msgPos:'masterGroupAdvice'">
                            <option value="">请选择</option>
                            <?php  $this->htmlOptions($projectOptions)?>
                        </select>
                        <div class="hint" id="masterGroupAdvice"></div>
                    </dd>
                </dl>
            </div>
        </div>
        <div class="buttonrow">
            <input type="submit" class="submit" value="<?php $this->put('保存管理员分组信息'); ?>"/>
        </div>
    </form>
    <?php $this->import('footer'); ?>
</body>

<script type="text/javascript">
window.addEvent('domready', function() {
    myFormValidator = new Form.Validator.Inline('theForm', {
        evaluateFieldsOnChange: false
    });
});
</script>
</html>